package com.crizzbe.storeManage.Controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.crizzbe.storeManage.entity.Buydetail;
import com.crizzbe.storeManage.entity.Company;
import com.crizzbe.storeManage.entity.Employee;
import com.crizzbe.storeManage.entity.User;
import com.crizzbe.storeManage.mapper.BuydetailMapper;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Crizzbe
 * @since 2021-06-22
 */
@RestController
@CrossOrigin
@RequestMapping("/StoreManage/buydetail")
public class BuydetailController {
@Autowired
 private BuydetailMapper buydetail;
@GetMapping("/")
private List<Buydetail>  index(){
	return buydetail.selectList(null);
}
@PostMapping("/add")
public void add(@RequestBody Buydetail parm) {
	buydetail.insert(parm);
}
@PostMapping("/delete")
public void deleteData(@RequestBody Company parm) {
	buydetail.deleteById(parm.Id);
}
@PostMapping("/update")

public void update(@RequestBody Buydetail form) {
      buydetail.updateById(form);
}

}

